import Vue from 'vue'
import Vuex from 'vuex'


const state = {
  isLoading:false,
  curSeletedRouterIndex:0,
  routers:[], // 固定路由(原始路由)
  addRouteList:[], // 新增
  routerAllList:[] // 总的路由
}

const mutations = {
  upDateLoadingStatus(state,flag){
    state.isLoading = flag
  },
  upDateSeletedRouterIndex(state,num){
    state.curSeletedRouterIndex = num
  },
  upDateAddRouteList(state,list){
    state.addRouteList = list
  },
  upDateRouters(state,list){
    state.routers = list
  },
  upDateAllRouters(state,list){
    state.routerAllList = list
  }
}

Vue.use(Vuex)

export default new Vuex.Store({
  state,
  mutations
})
